home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-11-27 | 34.3 KB | 1,245 lines |
- 10
- # or something immediately after the boot program prints out the kernel sizes.)
- # BOOTDIR is the directory in which the boot things live.
- #
-
- #if !empty(TM:Msun3)
- KERNELSTART ?= 0x3fe0
- LINKSTART ?= d4000
- #else
- #if !empty(TM:Msun4)
- KERNELSTART ?= 0x4000
- LINKSTART ?= $(KERNELSTART:S/0x/20/)
- #else
- #if !empty(TM:Mds3100)
- KERNELSTART ?= 0x80010000
- LINKSTART ?= $(KERNELSTART:S/0x//)
- #else
- #if !empty(TM:Msun4c)
- KERNELSTART ?= 0x3fe0
- LINKSTART ?= $(KERNELSTART:S/0x/20/)
- #else
- KERNELSTART ?= 0x4000
- LINKSTART ?= $(KERNELSTART:S/0x/b/)
- #endif
- #endif
- #endif
- #endif
-
- CFLAGS += -DBOOT_CODE=0x$(LINKSTART) \
- -DKERNEL_START=$(KERNELSTART) -DBOOTDIR=\"$(INSTALLDIR)\" \
- -DBOOT_FILE=\"$(TM)\"
-
-
- #
- # The .INCLUDES variable already includes directories that should be
- # used by cc and other programs by default. Remove them, just so that
- # the output looks cleaner.
-
- CFLAGS += $(.INCLUDES:S|^-I/sprite/lib/include$||g:S|^-I/sprite/lib/include/$(TM).md$||g)
-
- #
- # Transformation rules: these have special features to place .o files
- # in md subdirectories, run preprocessor over .s files, etc.
- # There are no profile rules for boot programs because they aren't profiled.
- #
-
- .c.o :
- $(RM) -f $(.TARGET)
- $(CC) $(CFLAGS) -c $(.IMPSRC) -o $(.TARGET)
- .s.o :
- #if empty(TM:Mds3100)
- $(CPP) $(CFLAGS:M-[ID]*) -m$(TM) -D$(TM) -D_ASM $(.IMPSRC) > $(.PREFIX).pp
- $(AS) -o $(.TARGET) $(AFLAGS) $(.PREFIX).pp
- $(RM) -f $(.PREFIX).pp
- #else
- $(RM) -f $(.TARGET)
- $(AS) $(AFLAGS) $(.IMPSRC) -o $(.TARGET)
- #endif
-
- #
- # The following targets are .USE rules for creating things.
- #
-
- #
- # MAKEBOOT usage:
- # <program> : <objects> <libraries> MAKEBOOT
- #
- # Similar to MAKECMD, except it doesn't create the version.[ho] files,
- # and the variable LINKSTART is used to define where the boot program
- # gets loaded.
- #
- MAKEBOOT : .USE -lc
- rm -f $(.TARGET)
- $(LD) -N -e start -T $(LINKSTART) $(CFLAGS:M-L*) $(LDFLAGS) \
- -o $(.TARGET) $(.ALLSRC:N-lc:Nend.o) -lc $(.ALLSRC:Mend.o)
-
- #
- # MAKEINSTALL usage:
- # install :: <dependencies> MAKEINSTALL
- #
- # The program is installed in $(TMINSTALLDIR) and backed-up to
- # $(TMINSTALLDIR).old
- #
- #ifndef NOBACKUP
- BACKUP = -b $(TMINSTALLDIR).old
- #ifdef BACKUPAGE
- BACKUP += -B $(BACKUPAGE)
- #endif
- #else
- BACKUP =
- #endif NOBACKUP
-
- MAKEINSTALL : .USE
- ${RM} -f $(TMINSTALLDIR)/$(NAME)
- ${INSTALL_PROG} $(TM).md/$(NAME) $(TMINSTALLDIR)/$(NAME)
-
- #
- # MAKELINT usage:
- # <fluff-file> : <sources to be linted> MAKELINT
- #
- # <fluff-file> is the place to store the output from the lint.
- #
- MAKELINT : .USE
- $(RM) -f $(.TARGET)
- $(LINT) $(LINTFLAGS) $(CFLAGS:M-[ID]*) $(.ALLSRC) > $(.TARGET) 2>&1
-
- #
- # MAKEDEPEND usage:
- # <dependency-file> : <sources> MAKEDEPEND
- #
- # Generate dependency file suitable for inclusion in future makes.
-
- MAKEDEPEND : .USE
- @$(TOUCH) $(DEPFILE)
- $(MAKEDEPEND) $(CFLAGS:M-[ID]*) -m $(TM) -w60 -f $(DEPFILE) $(.ALLSRC)
- @$(MV) -f $(DEPFILE) $(DEPFILE).tmp
- @$(SED) -e '/^#/!s|^.|$(TM).md/&|' <$(DEPFILE).tmp > $(DEPFILE)
- @$(RM) -f $(DEPFILE).tmp
-
- #if !defined(no_targets) && defined(NAME)
- #
- # We should define the main targets (make, make install, etc.). See the
- # mkmf man page for details on what these do.
- #
- LIBS ?=
-
- #
- # start.o must come first
- default : $(TM).md/$(NAME)
- $(TM).md/$(NAME) : $(TM).md/start.o $(OBJS:S/$(TM).md\/start.o//:S/makeBoot.o//) MAKEBOOT
-
-
- clean :: .NOEXPORT tidy
- $(RM) -f $(TM).md/$(NAME)
-
- tidy :: .NOEXPORT
- $(RM) -f $(CLEANOBJS) $(CLEANOBJS:M*.o:S/.o$/.po/g) \
- y.tab.c lex.yy.c core \
- $(TM).md/lint \
- a.out *~ $(TM).md/*~ version.h gmon.out mon.out
-
- DEPFILE = $(TM).md/dependencies.mk
-
- depend : $(DEPFILE)
- $(DEPFILE) ! $(SRCS:M*.c) $(SRCS:M*.s) MAKEDEPEND
-
-
- #
- # For "install", a couple of tricks. First, allow local.mk to disable
- # by setting no_install. Second, use :: instead of : so that local.mk
- # can augment install with additional stuff. Third, don't install if
- # TMINSTALLDIR isn't set.
- #
- #ifndef no_install
- #ifdef TMINSTALLDIR
- install :: $(TM).md/$(NAME) installman MAKEINSTALL
- #else
- install :: .SILENT
- echo "Can't install $(NAME): no install directory defined"
- #endif TMINSTALLDIR
- #endif no_install
-
-
- #if eg immediately after the boot program prints out the kernel sizes.)
- # BOOTDIR is the directory in which the boot things live.
- #
-
- #if !empty(TM:Msun3)
- KERNELSTART ?= 0x3fe0
- LINKSTART ?= d4000
- #else
- #if !empty(TM:Msun4)
- KERNELSTART ?= 0x4000
- LINKSTART ?= $(KERNELSTART:S/0x/20/)
- #else
- #if !empty(TM:Mds3100)
- KERNELSTART ?= 0x80010000
- LINKSTART ?= $(KERNELSTART:S/0x//)
- #else
- #if !empty(TM:Msun4c)
- KERNELSTART ?= 0x3fe0
- LINKSTART ?= $(KERNELSTART:S/0x/20/)
- #else
- KERNELSTART ?= 0x4000
- LINKSTART ?= $(KERNELSTART:S/0x/b/)
- #endif
- #endif
- #endif
- #endif
-
- CFLAGS += -DBOOT_CODE=0x$(LINKSTART) \
- -DKERNEL_START=$(KERNELSTART) -DBOOTDIR=\"$(INSTALLDIR)\" \
- -DOPENPROMS -DSAIO_COMPAT -DBOOT_FILE=\"$(TM)\"
-
-
- #
- # The .INCLUDES variable already includes directories that should be
- # used by cc and other programs by default. Remove them, just so that
- # the output looks cleaner.
-
- CFLAGS += $(.INCLUDES:S|^-I/sprite/lib/include$||g:S|^-I/sprite/lib/include/$(TM).md$||g)
-
- #
- # Transformation rules: these have special features to place .o files
- # in md subdirectories, run preprocessor over .s files, etc.
- # There are no profile rules for boot programs because they aren't profiled.
- #
-
- .c.o :
- $(RM) -f $(.TARGET)
- $(CC) $(CFLAGS) -c $(.IMPSRC) -o $(.TARGET)
- .s.o :
- #if empty(TM:Mds3100)
- $(CPP) $(CFLAGS:M-[ID]*) -m$(TM) -D$(TM) -D_ASM $(.IMPSRC) > $(.PREFIX).pp
- $(AS) -o $(.TARGET) $(AFLAGS) $(.PREFIX).pp
- $(RM) -f $(.PREFIX).pp
- #else
- $(RM) -f $(.TARGET)
- $(AS) $(AFLAGS) $(.IMPSRC) -o $(.TARGET)
- #endif
-
- #
- # The following targets are .USE rules for creating things.
- #
-
- #
- # MAKEBOOT usage:
- # <program> : <objects> <libraries> MAKEBOOT
- #
- # Similar to MAKECMD, except it doesn't create the version.[ho] files,
- # and the variable LINKSTART is used to define where the boot program
- # gets loaded.
- #
- MAKEBOOT : .USE -lc
- rm -f $(.TARGET)
- $(LD) -N -e start -T $(LINKSTART) $(CFLAGS:M-L*) $(LDFLAGS) \
- -o $(.TARGET) $(.ALLSRC:N-lc:Nend.o) -lc $(.ALLSRC:Mend.o)
-
- #
- # MAKEINSTALL usage:
- # install :: <dependencies> MAKEINSTALL
- #
- # The program is installed in $(TMINSTALLDIR) and backed-up to
- # $(TMINSTALLDIR).old
- #
- #ifndef NOBACKUP
- BACKUP = -b $(TMINSTALLDIR).old
- #ifdef BACKUPAGE
- BACKUP += -B $(BACKUPAGE)
- #endif
- #else
- BACKUP =
- #endif NOBACKUP
-
- MAKEINSTALL : .USE
- ${RM} -f $(TMINSTALLDIR)/$(NAME)
- ${INSTALL_PROG} $(TM).md/$(NAME) $(TMINSTALLDIR)/$(NAME)
-
- #
- # MAKELINT usage:
- # <fluff-file> : <sources to be linted> MAKELINT
- #
- # <fluff-file> is the place to store the output from the lint.
- #
- MAKELINT : .USE
- $(RM) -f $(.TARGET)
- $(LINT) $(LINTFLAGS) $(CFLAGS:M-[ID]*) $(.ALLSRC) > $(.TARGET) 2>&1
-
- #
- # MAKEDEPEND usage:
- # <dependency-file> : <sources> MAKEDEPEND
- #
- # Generate dependency file suitable for inclusion in future makes.
-
- MAKEDEPEND : .USE
- @$(TOUCH) $(DEPFILE)
- $(MAKEDEPEND) $(CFLAGS:M-[ID]*) -m $(TM) -w60 -f $(DEPFILE) $(.ALLSRC)
- @$(MV) -f $(DEPFILE) $(DEPFILE).tmp
- @$(SED) -e '/^#/!s|^.|$(TM).md/&|' <$(DEPFILE).tmp > $(DEPFILE)
- @$(RM) -f $(DEPFILE).tmp
-
- #if !defined(no_targets) && defined(NAME)
- #
- # We should define the main targets (make, make install, etc.). See the
- # mkmf man page for details on what these do.
- #
- LIBS ?=
-
- #
- # start.o must come first
- default : $(TM).md/$(NAME)
- $(TM).md/$(NAME) : $(TM).md/start.o $(OBJS:S/$(TM).md\/start.o//:S/makeBoot.o//) MAKEBOOT
-
-
- clean :: .NOEXPORT tidy
- $(RM) -f $(TM).md/$(NAME)
-
- tidy :: .NOEXPORT
- $(RM) -f $(CLEANOBJS) $(CLEANOBJS:M*.o:S/.o$/.po/g) \
- y.tab.c lex.yy.c core \
- $(TM).md/lint \
- a.out *~ $(TM).md/*~ version.h gmon.out mon.out
-
- DEPFILE = $(TM).md/dependencies.mk
-
- depend : $(DEPFILE)
- $(DEPFILE) ! $(SRCS:M*.c) $(SRCS:M*.s) MAKEDEPEND
-
-
- #
- # For "install", a couple of tricks. First, allow local.mk to disable
- # by setting no_install. Second, use :: instead of : so that local.mk
- # can augment install with additional stuff. Third, don't install if
- # TMINSTALLDIR isn't set.
- #
- #ifndef no_install
- #ifdef TMINSTALLDIR
- install :: $(TM).md/$(NAME) installman MAKEINSTALL
- #else
- install :: .SILENT
- echo "Can't install $(NAME): no install directory defined"
- #endif TMINSTALLDIR
- #endif no_insta╨áDæ2 û
- ╨áDÿ
- É